﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

static public class AllContentTexture
{
    static public Dictionary<string,Texture2D> TextureDict = new Dictionary<string,Texture2D>(1000);

    static public void ClearDestroy()
    {
        foreach(var texture in TextureDict.Values)
        {
            Object.Destroy(texture);
        }
        TextureDict.Clear();
    }

    public static Texture Get(string itemPath)
    {
        if (TextureDict.TryGetValue(itemPath, out var texture))
        {
            return texture;
        }
        return Resources.Load<Texture>(MiaoFilePaths.ContentPath<AudioClip>() + itemPath);
    }


}

